import ElementPlus from 'element-plus';
import 'uno.css';
import '../../../src/style.css';
import './vitepress.css';
import 'element-plus/dist/index.css';
import DefaultTheme from 'vitepress/theme';
import Demo from '../../packages/component/container/element-plus/ElementPlus.vue';
// import Nstd from '../../../src/packages/index';
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import ThemeComp from './ThemeComp.vue';
import { h } from 'vue';

export default {
  ...DefaultTheme,
  Layout() {
    return h(DefaultTheme.Layout, null, {
      'nav-bar-content-after': () => h(ThemeComp)
    });
  },
  async enhanceApp({ app }) {
    app.use(ElementPlus, { locale: zhCn });
    app.component('Demo', Demo);
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component);
    }
    if (!import.meta.env.SSR) {
      const Nstd = await import('../../../src/packages/index');
      app.use(Nstd.default);
    }
  }
};
